<%@ Page Language="VB" MasterPageFile="~/MasterPage.master" AutoEventWireup="false"
    CodeFile="OnSiteMaintain.aspx.vb" Inherits="WebForm_OnSiteMaintain" %>

<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
      <asp:UpdatePanel ID="UpdatePanel1" runat="server">
        <ContentTemplate>
            <asp:HiddenField ID="hiUID" runat="server" />
            <asp:HiddenField ID="hiKind" runat="server" />
            <table width="100%">
                <tr>
                    <td style="text-align: center">
                        <asp:Label ID="lblTitle" runat="server" Font-Bold="True" Font-Size="24px" meta:resourcekey="lblTitle"></asp:Label>
                    </td>
                </tr>
            </table>
            <asp:Button ID="btnInsert" runat="server" meta:resourcekey="btnInsert" />
            <br />
            <asp:ObjectDataSource ID="objDSsite" runat="server" SelectMethod="GetAllSite1" 
                TypeName="Telecom.BBL.SiteBBL">
                <SelectParameters>
                    <asp:ControlParameter ControlID="hiDBName" Name="dbName" PropertyName="Value" />
                </SelectParameters>
            </asp:ObjectDataSource>
            <asp:ObjectDataSource ID="dsOnSite" runat="server" 
                SelectMethod="GetOnSite" TypeName="Telecom.BBL.OnSiteBBL" 
                UpdateMethod="UpdateOnSite" DeleteMethod="DeleteOnSite">
                <DeleteParameters>
                    <asp:Parameter Name="Site" Type="String" ConvertEmptyStringToNull ="false"  />
                      <asp:ControlParameter ControlID="hiDBName" Name="dbName" PropertyName="Value" 
                        Type="String" />
                </DeleteParameters>
                <UpdateParameters>
                    <asp:Parameter Name="canModi" Type="Boolean" />
                    <asp:Parameter Name="Site" Type="String"  ConvertEmptyStringToNull ="false" />
                    <asp:Parameter Name="IT_Approver" Type="String" ConvertEmptyStringToNull ="false" DefaultValue =""/>
                    <asp:Parameter Name="OnSiteUID" Type="String"  ConvertEmptyStringToNull ="false"  DefaultValue =""/>
                    <asp:ControlParameter ControlID="hiUID" Name="ModiUID" PropertyName="Value" 
                        Type="String" />
                       <asp:ControlParameter ControlID="hiDBName" Name="dbName" PropertyName="Value" 
                        Type="String" />
                </UpdateParameters>
                <SelectParameters>
                    <asp:ControlParameter ControlID="hiKind" ConvertEmptyStringToNull="False"  DefaultValue =""
                        Name="Kind" PropertyName="Value" Type="String" />
                    <asp:Parameter Name="Site" Type="String"  ConvertEmptyStringToNull ="false" DefaultValue ="" />
                    <asp:ControlParameter ControlID="hiDBName" Name="dbName" PropertyName="Value" 
                        Type="String" />
                </SelectParameters>
            </asp:ObjectDataSource>
            <asp:HiddenField ID="hiDBName" runat="server" />
            <TServerControl:TGridView ID="gvOnSite" runat="server" AllowHoverEffect="True" 
                AllowHoverSelect="True" AllowPaging="True" AutoGenerateColumns="False" DataSourceID="dsOnSite" 
                ShowFooterWhenEmpty="False" ShowHeaderWhenEmpty="True" SkinID="pager" 
                TotalRowCount="0">
                <Columns>
                    <asp:TemplateField>
                        <EditItemTemplate>
                            <asp:Button ID="btnUpdate" runat="server" CommandName="Update" meta:resourcekey="btnUpdate" />
                            <asp:Button ID="btnCancel" runat="server" CommandName="Cancel" meta:resourcekey="btnCancel" />
                        </EditItemTemplate>
                        <ItemTemplate>
                            <asp:Button ID="btnEdit" runat="server" CommandName="Edit" meta:resourcekey="btnEdit"
                                Text="Button" />
                        </ItemTemplate>
                    </asp:TemplateField>
                        <asp:TemplateField>
                        <EditItemTemplate>
                        
                       
                        </EditItemTemplate>
                        <ItemTemplate>
                            <asp:Button ID="btnDelete" runat="server" CommandName="Delete" meta:resourcekey="btnDelete"
                                Text="Button" CommandArgument='<%# Bind("Site") %>' />
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField meta:resourcekey="colSite">
                        <ItemTemplate>
                            <asp:DropDownList ID="ddlSite" runat="server" DataSourceID="objDSsite" 
                                DataTextField="site_name" DataValueField="site_code" Enabled="False" 
                               
                                SelectedValue='<%# Bind("Site") %>'>
                            </asp:DropDownList>
                        </ItemTemplate>
                        <EditItemTemplate>
                            <asp:DropDownList ID="ddlSite" runat="server" 
                                DataSourceID="objDSsite" DataTextField="site_name" DataValueField="site_code" 
                                Enabled='<%# Bind("canModi") %>' 
                                SelectedValue='<%# Bind("Site") %>'>
                            </asp:DropDownList>
                        </EditItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField meta:resourcekey="colIT_Approver">
                        <EditItemTemplate>
                            <asp:TextBox ID="txtIT_Approver" runat="server" Text='<%# Bind("IT_Approver") %>'
                                Width="68px"></asp:TextBox>                           
                            <asp:LinkButton ID="btnIT_Approver" runat="server" 
                                onclick="btnIT_Approver_Click">...</asp:LinkButton>
                        </EditItemTemplate>
                        <ItemTemplate>
                            <asp:Label ID="lblIT_Approver" runat="server" Text='<%# Bind("ITApproveName") %>' Width="68px"></asp:Label>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField meta:resourcekey="colOnSiteUID">
                        <EditItemTemplate>
                            <asp:TextBox ID="txtOnSiteUID" runat="server" Text='<%# Bind("OnSiteUID") %>'
                                Width="68px"></asp:TextBox>                           
                            <asp:LinkButton ID="btnOnSiteUid" runat="server" onclick="btnOnSiteUID_Click">...</asp:LinkButton>
                        </EditItemTemplate>
                        <ItemTemplate>
                            <asp:Label ID="lblOnSiteUID" runat="server" Text='<%# Bind("OnSiteName") %>' Width="68px"></asp:Label>
                        </ItemTemplate>
                    </asp:TemplateField>
                     <asp:TemplateField meta:resourcekey="colCrtUID">                       
                        <ItemTemplate>
                            <asp:Label ID="lblCrtUID" runat="server" Text='<%# Eval("CrtName") %>' Width="68px"></asp:Label>
                        </ItemTemplate>
                    </asp:TemplateField>
                     <asp:TemplateField meta:resourcekey="colCrtDate">                       
                        <ItemTemplate>
                            <asp:Label ID="lblCrtDate" runat="server" Text='<%# Eval("CrtDate") %>' Width="68px"></asp:Label>
                        </ItemTemplate>
                    </asp:TemplateField>
                     <asp:TemplateField meta:resourcekey="colModiUID">                       
                        <ItemTemplate>
                            <asp:Label ID="lblModiUID" runat="server" Text='<%# Eval("ModiName") %>' Width="68px"></asp:Label>
                        </ItemTemplate>
                    </asp:TemplateField>
                     <asp:TemplateField meta:resourcekey="colModiDate">                       
                        <ItemTemplate>
                            <asp:Label ID="lblModiDate" runat="server" Text='<%# Eval("ModiDate") %>' Width="68px"></asp:Label>
                        </ItemTemplate>
                    </asp:TemplateField>
                    
                </Columns>
            </TServerControl:TGridView>
            <br />
            
            
            
       </ContentTemplate>
    </asp:UpdatePanel>        
       
</asp:Content>
